
import javax.swing.JOptionPane;

/*
 * CadastroCandidato.java
 *
 * Created on 22 de Junho de 2008, 12:29
 */

/**
 *
 * @author  Bárbara
 */
public class SelecaoCandidato extends javax.swing.JInternalFrame {

    testeInterface t = new testeInterface();
    
    /** Creates new form CadastroCandidato */
    public SelecaoCandidato() {
        initComponents();
    }

   
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        NomeCand = new javax.swing.JLabel();
        btCadCand = new javax.swing.JButton();
        btCancCadCand = new javax.swing.JButton();
        boxSelOpCand = new javax.swing.JComboBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("CANDIDATOS");

        NomeCand.setFont(new java.awt.Font("Tahoma", 1, 12));
        NomeCand.setText("Selecione a opcao desejada:");

        btCadCand.setText("Confirmar");
        btCadCand.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCadCandActionPerformed(evt);
            }
        });

        btCancCadCand.setText("Cancelar");
        btCancCadCand.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancCadCandActionPerformed(evt);
            }
        });

        boxSelOpCand.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cadastrar Candidato", "Alterar Candidato", "Remover Candidato" }));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(NomeCand)
                .addGap(41, 41, 41)
                .addComponent(boxSelOpCand, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(27, 27, 27))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(129, Short.MAX_VALUE)
                .addComponent(btCadCand)
                .addGap(63, 63, 63)
                .addComponent(btCancCadCand)
                .addGap(129, 129, 129))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(NomeCand)
                    .addComponent(boxSelOpCand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btCadCand)
                    .addComponent(btCancCadCand))
                .addGap(21, 21, 21))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void btCadCandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCadCandActionPerformed
// TODO add your handling code here:
    if (boxSelOpCand.getSelectedIndex()==0){
       cadastrarCand c = new cadastrarCand();
       //t.painelDeExibicao.add(c);
       c.setVisible(true);
    }else if (boxSelOpCand.getSelectedIndex()==1){
         alterarCandidato a = new alterarCandidato();
         a.setVisible(true);
    }else if (boxSelOpCand.getSelectedIndex()==2){
        deletarCandidato d = new deletarCandidato();
        d.setVisible(true);
    }
    dispose();
        

}//GEN-LAST:event_btCadCandActionPerformed

private void btCancCadCandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancCadCandActionPerformed
    dispose();
}//GEN-LAST:event_btCancCadCandActionPerformed

      
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel NomeCand;
    private javax.swing.JComboBox boxSelOpCand;
    private javax.swing.JButton btCadCand;
    private javax.swing.JButton btCancCadCand;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    // End of variables declaration//GEN-END:variables

}
